package com.ssy.lingxi.settle.accounts.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 业务请款单-开票记录DO
 * @author 彭冬冬
 * @date 2022/1/6
 * @version 2.0.0
 */
@Entity
@Table(schema = "public",
        name = "sa_business_reconciliation_invoice_record",
        indexes = {@Index(name = "sa_business_reconciliation_invoice_record_reconciliation_id_idx", columnList = "reconciliation_id"),
                @Index(name = "sa_business_reconciliation_invoice_record_invoice_id_idx", columnList = "invoiceId"),
                @Index(name = "sa_business_reconciliation_invoice_record_proof_id_idx", columnList = "proofId")}
)
public class BusinessReconciliationInvoiceRecordDO implements Serializable {
    private static final long serialVersionUID = -8047818555355188248L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sa_business_reconciliation_invoice_record_seq")
    @SequenceGenerator(sequenceName = "sa_business_reconciliation_invoice_record_seq", name = "sa_business_reconciliation_invoice_record_seq", allocationSize = 1)
    private Long id;

    /**
     * 多对一双向关联对账单
     */
    @JsonBackReference
    @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REFRESH}, optional = false)
    @JoinColumn(name = "reconciliation_id")
    private BusinessReconciliationDO reconciliation;

    /**
     * 会员收据发票id
     */
    @Column
    private Long invoiceId;

    /**
     * 会员收据发票凭证id
     */
    @Column
    private Long proofId;

    /**
     * 发票号码
     */
    @Column
    private String number;
    /**
     * 开票日期
     */
    @Column

    private String invoiceDate;
    /**
     * 开票金额
     */
    @Column
    private BigDecimal invoiceAmount;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public BusinessReconciliationDO getReconciliation() {
        return reconciliation;
    }

    public void setReconciliation(BusinessReconciliationDO reconciliation) {
        this.reconciliation = reconciliation;
    }

    public Long getInvoiceId() {
        return invoiceId;
    }

    public void setInvoiceId(Long invoiceId) {
        this.invoiceId = invoiceId;
    }

    public Long getProofId() {
        return proofId;
    }

    public void setProofId(Long proofId) {
        this.proofId = proofId;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(String invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public BigDecimal getInvoiceAmount() {
        return invoiceAmount;
    }

    public void setInvoiceAmount(BigDecimal invoiceAmount) {
        this.invoiceAmount = invoiceAmount;
    }
}
